#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
using namespace std;
int main()
{
    int T;
    cin >> T;
    while (T--)
    {
        long long n;
        scanf("%ld", &n);
        int count = 0;
        while (n)
        {
            if (n % 2 == 0)
                n = n / 2 - 1;
            else n = n / 2;
            count++;
        }
        printf("%d\n", count);

    }
    return 0;
}